using System;
using System.Collections.Generic;
using System.Text;

namespace PocketLibrary.Image
{
    public class flickrContact
    {
        private string _nsid;

        public string Id
        {
            get { return _nsid; }
        }

        private string _username;
        public string UserName
        {
            get { return _username; }
        }

        private string _realname;
        public string RealName
        {
            get { return _realname; }
        }

        private string _isfriend;
        public string IsFriend
        {
            get { return _isfriend; }
        }

        private string _isfamily;
        public string IsFamily
        {
            get { return _isfamily; }
        }
        private string _ignored;
        public string Ignored
        {
            get { return _ignored; }
        }

        private string _iconServer;

        public string IconServer
        {
            get { return _iconServer; }
            set { _iconServer = value; }
        }

        private string _iconFarm;

        public string IconFarm
        {
            get { return _iconFarm; }
            set { _iconFarm = value; }
        }



        public flickrContact(string id, string username, string realname,
            string friend, string family, string ignored)
        {
            _nsid = id;
            _username = username;

            if (realname == "")
                _realname = username;
            else
                _realname = realname;

            _isfriend = friend;

        }


        public string BuddyIconUrl
        {
            get
            {
                if (_iconFarm != "" && _iconServer != "" && _iconFarm!="0")
                {
                    return string.Format(
                        "http://farm{0}.static.flickr.com/{1}/buddyicons/{2}.jpg",
                        _iconFarm, _iconServer, _nsid);
                }
                else
                    return "http://www.flickr.com/images/buddyicon.jpg";
            }
        }
    }
}
//	            <contact nsid="41578656547@N01" username="cal_abc" iconserver="1"
//		            realname="Cal Henderson"
//		            friend="1" family="1" ignored="0" />
